//package com.example.demo05.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.cors.CorsConfiguration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//@Configuration
//public class CorsConfig implements WebMvcConfigurer {
//    @Override
//    public void addCorsMappings(CorsRegistry registry) {
//        registry.addMapping("/**")
//                .allowedOriginPatterns("*")
//                .allowedHeaders(CorsConfiguration.ALL)
//                .allowedMethods(CorsConfiguration.ALL)
////                .allowedMethods("GET","POST","PUT","DELETE","OPTIONS")
////                .allowedHeaders("*")
//                .allowCredentials(true)
//                .maxAge(3600);//1个小时内不需要再预检(发OPTIONS请求,检查是否正常后，再发get请求)
//    }
//}
